Conversation
| have to keep making new code for any updates!!! | ||
| .length is what we need to use but I have tried | ||
| and not figured out the correct method yet! */ | ||
| while (index >3) {index = index -4}; |
There was a problem hiding this comment.
this is smart, you just need to use the array.length in your while condition
while (index >array.length)
| const arrayToCSVString = array => { | ||
| // your code here | ||
| //pass | ||
| return array.toString('') |
There was a problem hiding this comment.
should have used .join here
| // your code here | ||
| // pass | ||
| array.push(element); | ||
| //array.push([element]); |
There was a problem hiding this comment.
you should get rid of commented out code, commented code is dead code! 💀
| //pass | ||
| /*filter function maybe??? | ||
| using filter and then giving a function named that function X. | ||
| X % 2 should give back all even numbers but I don't quite understand the maths per usual |
There was a problem hiding this comment.
maths is simple here
% 2 is saying
divide the number by 2, if the remainder is zero, then you have an even number :)
| @@ -1,61 +1,96 @@ | |||
| const negate = a => { | |||
| // your code here | |||
| if (a && a){ | |||
There was a problem hiding this comment.
return !a would have sufficed here
ersel
left a comment
There was a problem hiding this comment.
Some problems with the numbers and strings modules. I hope you can see the problem with those when you look at them now. If not, please ask a mentor/tutor at the next session to help explain why your functions are not generic enough.
|
|
||
| const truthiness = a => { | ||
| // your code here | ||
|
|
There was a problem hiding this comment.
return Boolean(a) would have sufficed
| const startsWith = (char, string) => { | ||
| // your code here | ||
| }; | ||
| return (char, string.startsWith("a", "aardvark")) |
There was a problem hiding this comment.
return string.startsWith(char)
| const add = (a, b) => { | ||
| // your code here | ||
| let total = ""; | ||
| if (a === 2, b === 1){ |
There was a problem hiding this comment.
This is not a valid condition, you can't use a comma to separate conditions. You need to use logical operators && or ||
|
|
||
| const round = a => { | ||
| // your code here | ||
| let total = ""; |
There was a problem hiding this comment.
return Math.round(a)
use the parameters, don't check for specific values!
| @@ -1,45 +1,203 @@ | |||
| const add = (a, b) => { | |||
There was a problem hiding this comment.
This module is wrong, almost in all these cases you wrote unnecessary logical statements. You should think about the generic case
| @@ -1,25 +1,98 @@ | |||
| const sayHello = string => { | |||
| // your code here | |||
| const sayHello = (string) => { | |||
There was a problem hiding this comment.
same problem here, you wrote code for each specific value rather than generalizing your solution dependent on the parameters.
No description provided.